package util;

public class ErrorCodeMap {
    private int errorCode;

    public ErrorCodeMap() {

    }

    public int getErrorCode() {
        return errorCode;
    }
    public void setErrorCode(int errorCode){
        this.errorCode = errorCode;
    }

    public String getErrorName(int code) {
        switch(code) {
            case 0:
                return "NO_ERROR";
            case 1:
                return "INSTANCE_NOT_AVAILABLE";
            case 2:
                return "INSTANCE_IN_USE";
            case 3:
                return "ACCESS_VIOLATION";
            case 4:
                return "ACCESS_NOT_ALLOWED_IN_CURRENT_STATE";
            case 5:
                return "PARAMETER_VALUE_INAPPROPRIATE";
            case 6:
                return "PARAMETER_VALUE_INCONSISTENT";
            case 7:
                return "CLASS_NOT_SUPPORTED";
            case 8:
                return "INSTANCE_LOCKED_BY_OTHER_CLIENT";
            case 9:
                return "CONTROL_MUST_BE_SELECTED";
            case 10:
                return "TYPE_CONFLICT";
            case 11:
                return "FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT";
            case 12:
                return "FAILED_DUE_TO_SERVER_CONSTRAINT";
            case 13:
                return "APPLICATION_UNREACHABLE";
            case 14:
                return "CONNECTION_LOST";
            case 15:
                return "MEMORY_UNAVAILABLE";
            case 16:
                return "PROCESSOR_RESOURCE_UNAVAILABLE";
            case 17:
                return "FILE_NONE_EXISTENT";
            case 18:
            case 19:
            case 21:
            default:
                return "Unknown ServiceError code";
            case 20:
                return "FATAL";
            case 22:
                return "TIMEOUT_ERROR";
            case 23:
                return "UNKNOWN";
        }
    }
}
